home *** CD-ROM | disk | FTP | other *** search
/ PowerGen / PowerGen CD-ROM.ISO / Win95_NT / Gamezone / ENGAGE / SYSTEM / PLUGINIE / SETUP.RUL < prev    next >
Text File  |  1997-11-05  |  25KB  |  580 lines

  1. /***************************************************************************/
  2. /***                                                                     ***/
  3. /***  Setup.Rul                                                          ***/
  4. /***                                                                     ***/
  5. /***    This is the Setup.Rul file for the Internet Explorer Engage      ***/
  6. /***    System Components.                                               ***/
  7. /***                                                                     ***/    
  8. /***************************************************************************/
  9. /***                                                                     ***/
  10. /***    Version Information:                                             ***/
  11. /***                                                                     ***/
  12. /***    Version      Date      Initials     Notes                        ***/
  13. /***    *******    ********    ********     *****                        ***/
  14. /***     1.5.16    07/22/97      SEH        Added Buttonbar Local Store  ***/
  15. /***     1.5.15    07/22/97      SEH        Rev-ed to keep up with Nav.  ***/
  16. /***     1.5.14    07/10/97      SEH        Rev-ed to keep up with Nav.  ***/
  17. /***     1.5.13    05/12/97      SEH        Two installs now generated,  ***/
  18. /***                                        one with LS and one w/o.     ***/
  19. /***     1.5.12    03/31/97      SEH        Added iChat v2.22            ***/
  20. /***     1.5.11    03/31/97      SEH        Updated Local Store          ***/
  21. /***     1.5.10    03/31/97      SEH        Fixed a registry bug         ***/
  22. /***     1.5.09    03/31/97      SEH        Added new ICAML.EXE v1.43    ***/
  23. /***     1.5.08    03/31/97      SEH        Updated Local Store          ***/
  24. /***     1.5.07    03/31/97      SEH        Various Updates              ***/
  25. /***      1.5      02/24/97      SEH        Update with versioning info  ***/
  26. /***      1.1      02/03/97      SEH        Baseline                     ***/
  27. /***                                                                     ***/
  28. /***************************************************************************/
  29. /***                                                                     ***/
  30. /***    Version 1.5.13                                                   ***/
  31. /***    **************                                                   ***/
  32. /***    This version of the system components is a change in how it is   ***/
  33. /***    compiled. The m.bat file that builds the entire self-extracting  ***/
  34. /***    zipfile builds the system components without local storage and   ***/
  35. /***    mls.bat builds the system components with local storage.         ***/
  36. /***                                                                     ***/
  37. /***    Version 1.5.07                                                   ***/
  38. /***    **************                                                   ***/
  39. /***    Up to this point, there have been alot of updates to the         ***/
  40. /***    NPEOVER.DLL, with a few updates to the actual script. These      ***/
  41. /***    updates include:                                                 ***/
  42. /***    1. A Local store was added to the system components that holds   ***/
  43. /***       alot of the WWW site information so that it does not require  ***/
  44. /***       download. The system components now check for this on a       ***/
  45. /***       user's computer and deletes it before installing the new one. ***/
  46. /***    2. Checks the Java and JavaScript settings and verifies they are ***/
  47. /***       enabled. If they are not, the user can enable them in this    ***/
  48. /***       install.                                                      ***/
  49. /***    3. If the user has multiple instances of the browser running,    ***/
  50. /***       the user will be prompted to close each one of them           ***/
  51. /***    4. The system components now check for the version of the        ***/
  52. /***       browser installed on a user's system and only prompts the     ***/
  53. /***       user if his version is not supported.                         ***/
  54. /***    5. System Components install path.                               ***/
  55. /***    6. Various other text message changes.                           ***/
  56. /***                                                                     ***/
  57. /***    Version 1.5                                                      ***/
  58. /***    ***********                                                      ***/
  59. /***    This version has several changes:                                ***/
  60. /***    1. Calls UEngage1.Exe that updates the game client applications  ***/
  61. /***       with the versioning information for v1.5.                     ***/
  62. /***    2. While searching for IEXPLORE.EXE, a message is displayed      ***/
  63. /***       telling the user what is happening. If it cannot find it,     ***/
  64. /***       it prompts the user for the IE Plug-Ins path.                 ***/
  65. /***    3. At the beginning of the install, it searches for IE running   ***/
  66. /***       and asks the user if he wants it closed. No close = abort     ***/
  67. /***       install.                                                      ***/
  68. /***                                                                     ***/
  69. /***    Version 1.1                                                      ***/
  70. /***    ***********                                                      ***/
  71. /***    This is the first version of this file that I have rewritten.    ***/
  72. /***    The original was written by John Spence. This version contains   ***/
  73. /***    DirectX Version checking and an additional set of registry       ***/
  74. /***    entries that tell game clients the path to both Plug-Ins and     ***/
  75. /***    System Components.                                               ***/
  76. /***                                                                     ***/
  77. /***************************************************************************/
  78.  
  79. declare
  80. #include "SdDialog.h"
  81. #include "DirectX.h"
  82. #include "Browsers.h"
  83. #include "Constant.h"
  84. #include "IEHeader.h"
  85.  
  86. // Update Engage Applications Tool declarations.
  87. #define UENGAGE1_EXE            "UEngage1.Exe"
  88. #define UENGAGE1_OPTIONS        "-s"
  89.  
  90. // Constant declarations.
  91. #define SPACE_REQUIRED          2000000          // Disk space in bytes.
  92. #define APP_NAME                "GamesZone System Components"
  93. #define APPBASE_PATH            "Program Files\\Engage\\IE"
  94. #define COMPANY_NAME            "GamesZone"
  95. #define PRODUCT_NAME            "GamesZone System Components"
  96. #define PRODUCT_VERSION         "1.5.16"
  97. #define DEINSTALL_KEY           "EngageSystemIEDeinstKey"
  98. #define UNINSTALL_NAME          "GamesZone System Components for Internet Explorer"
  99. #define PRODUCT_KEY             "EngageIE"
  100.  
  101.         // Global variable declarations.
  102.         STRING  svFolder, svDir, szMsg, szFileSet, szTitle, svUninstLogFile;
  103.         STRING  svTarget, szProgram, szParam, szTemp, szAppPath, szSource;
  104.         STRING  szKey, szMimeType, szExec, svValue, svString, szExtension;
  105.         STRING  szExtFile, svEditFlags, szExtFileKey;
  106.         STRING  szDialogMsg;
  107.         BOOL    bSpaceOk;
  108.         NUMBER  nResult, nReturn, nvType, nvSize, nTypeIndex, nDirectXVersion;
  109.  
  110.         // Function declarations.
  111.         prototype SetupScreen();
  112.         prototype CheckRequirements();
  113.         prototype GetHandAndLaunchAppWait(STRING, STRING, STRING, STRING, LONG);
  114.         prototype KERNEL32.Sleep(LONG);
  115.         prototype AddApplicationPathsToRegistry();
  116.  
  117. program
  118.  
  119. StartHere:
  120.         Disable( BACKGROUND );
  121.  
  122.         // Set installation info., which is required for registry entries.
  123.         InstallationInfo( COMPANY_NAME, PRODUCT_NAME, PRODUCT_VERSION, PRODUCT_KEY );
  124.  
  125.         // Set up the installation screen.
  126.         SetupScreen();
  127.         Enable( DIALOGCACHE );
  128.  
  129.  
  130.    // Create a Welcome dialog.
  131.    WelcomeDlg:
  132.         Disable( BACKBUTTON );
  133.         Welcome( "", 0 );
  134.         Enable( BACKBUTTON );
  135.  
  136.         // Test target system for proper configuration.
  137.         CheckRequirements();
  138.  
  139.    // Ask user for a destination location for the installation.--
  140.    GetTargetDirectory:
  141.         svTarget = TARGETDISK ^ APPBASE_PATH; //ex. C:\progra~1\engage
  142.         szMsg = "";
  143.  
  144.         if ( AskDestPath( "", szMsg,
  145.                           svTarget, 0 ) = 12 ) then
  146.            goto WelcomeDlg;
  147.         endif;
  148.  
  149.         // Perform space check of target drive.
  150.         bSpaceOk = TRUE;
  151.         if (GetDiskSpace( svTarget ) < SPACE_REQUIRED) then
  152.            szMsg = "There is not enough space available on the disk\n" +
  153.                    "'" + svTarget + "' \n" +
  154.                    "Please free up some space or change the target location\n" +
  155.                    "to a different disk";
  156.            MessageBox( szMsg, WARNING );
  157.            bSpaceOk = FALSE;
  158.         endif;
  159.  
  160.         // If not enough space, ask user to try again.
  161.         if (bSpaceOk = FALSE) goto GetTargetDirectory;
  162.  
  163.    DeleteOldLocalStore:
  164.       if (ExistsDir(svTarget^"Local Store") = EXISTS) then
  165.          DeleteDir (svTarget^"Local Store", ALLCONTENTS);
  166.       endif;
  167.  
  168.    SetupFilesToTransfer:
  169.         szFileSet = "General";
  170.         TARGETDIR = svTarget;
  171.  
  172.         // Define the file set.
  173.         FileSetBeginDefine( szFileSet );
  174.  
  175.            SetStatusWindow( -1, "Copying program files..." );
  176.  
  177.            // Uncompress files from installation library 
  178.            CompressGet( "DATA.Z", "*.*", INCLUDE_SUBDIR );
  179.  
  180.         FileSetEndDefine( szFileSet );
  181.  
  182.  
  183.    TransferFiles:
  184.         // Prepare InstallShield to record deinstallation information.
  185.         DeinstallStart( svTarget, svUninstLogFile, DEINSTALL_KEY, 0 );
  186.         RegDBSetItem( REGDB_UNINSTALL_NAME, UNINSTALL_NAME );
  187.  
  188.         // Set up progress indicator and information gauge.
  189.         Disable( DIALOGCACHE );
  190.         Enable( STATUSDLG );
  191.  
  192.         StatusUpdate( ON, 90 );
  193.  
  194.         // Perform the file set.
  195.         SetStatusWindow( 0, "Copying program files..." );
  196.         nResult = FileSetPerformEz( szFileSet, 0 );
  197.  
  198.         switch (nResult)
  199.  
  200.         case FS_DONE: // Successful completion.
  201.  
  202.         case FS_CREATEDIR: // Create directory error.
  203.              MessageBox( "Unable to create a directory under " + TARGETDIR + "."+
  204.                          "Please check write access to this directory.", SEVERE );
  205.              exit;
  206.  
  207.         default: // Group all other errors under default label.
  208.              NumToStr( szTemp, nResult );
  209.              MessageBox( "General file transfer error."+
  210.                           "Please check your target location and try again."+
  211.                           "\n\n Error Number:"+szTemp +
  212.                           "\n Related File: "+ERRORFILENAME,
  213.                           SEVERE );
  214.              exit;
  215.         endswitch;
  216.  
  217.  
  218.    SetRegistryEntries:
  219.         // Set the Base Key for Internet Explorer Registry entries
  220.         RegDBSetDefaultRoot (HKEY_CLASSES_ROOT);
  221.  
  222.         // Set variables for Internet Explorer Viewer configuration entries 
  223.         szKey = "\\MIME\\Database\\Content Type";
  224.         szMimeType = "application/x-engage";
  225.         szExec = "\"" + svTarget ^ "ICAML.EXE\"";
  226.         szExtension = ".ego";
  227.         szExtFile = "egofile";
  228.         szExtFileKey = "\\egofile";
  229.  
  230.         // Set Mime Registry entry
  231.         if (RegDBCreateKeyEx(szKey ^ szMimeType, "") < 0) then
  232.            MessageBox("Failed to create Mime key", WARNING);
  233.         else
  234.            
  235.            if (RegDBSetKeyValueEx(szKey ^ szMimeType, "Extension", REGDB_STRING, szExtension, -1) < 0) then
  236.               MessageBox("Failed to set Mime key Extension value", WARNING);
  237.            endif;
  238.  
  239.         endif;
  240.  
  241.         // Set Extension Registry entry
  242.         if (RegDBCreateKeyEx(szExtension, "") < 0) then
  243.            MessageBox("Failed to create Extension key", WARNING);
  244.         else
  245.            
  246.            if (RegDBSetKeyValueEx(szExtension, "", REGDB_STRING, szExtFile, -1) < 0) then
  247.               MessageBox("Failed to set Extension key Default value", WARNING);
  248.            endif;
  249.  
  250.            if (RegDBSetKeyValueEx(szExtension, "Content Type", REGDB_STRING, szMimeType, -1) < 0) then
  251.               MessageBox("Failed to set Extension key Content Type value", WARNING);
  252.            endif;
  253.  
  254.         endif;
  255.  
  256.         // Set Extension File Registry entry
  257.         if (RegDBCreateKeyEx(szExtFileKey, "") < 0) then
  258.            MessageBox("Failed to create Extension File key", WARNING);
  259.         else
  260.            
  261.            if (RegDBSetKeyValueEx(szExtFileKey, "", REGDB_STRING, "Engage Launch Document", -1) < 0) then
  262.               MessageBox("Failed to set Extension File key Default value", WARNING);
  263.            endif;
  264.  
  265.            SetByte(svEditFlags, 0, 0);
  266.            SetByte(svEditFlags, 1, 0);
  267.            SetByte(svEditFlags, 2, 1);  /* cause IE to always open */
  268.            SetByte(svEditFlags, 3, 0);
  269.  
  270.            if (RegDBSetKeyValueEx(szExtFileKey, "EditFlags", REGDB_BINARY, svEditFlags, 4) < 0) then
  271.               MessageBox("Failed to set Extension File key EditFlags value", WARNING);
  272.            endif;
  273.  
  274.            if (RegDBCreateKeyEx(szExtFileKey ^ "Shell", "") < 0) then
  275.               MessageBox("Failed to create Extension File Shell key", WARNING);
  276.            else
  277.  
  278.               if (RegDBCreateKeyEx(szExtFileKey ^ "Shell" ^ "open", "") < 0) then
  279.                  MessageBox("Failed to create ExtFile Shell open key", WARNING);
  280.               else
  281.  
  282.                  if (RegDBCreateKeyEx(szExtFileKey ^ "Shell" ^ "open" ^ "command", "") < 0) then
  283.                     MessageBox("Failed to create ExtFile Shell open command key", WARNING);
  284.                  else
  285.                     szKey = szExtFileKey ^ "Shell" ^ "open" ^ "command";
  286.                     if (RegDBSetKeyValueEx(szKey, "", REGDB_STRING, szExec + " %1", -1) < 0) then
  287.                        MessageBox("Failed to set ExtFile Shell open command Default value", WARNING);
  288.                     endif;
  289.                  endif;
  290.               endif;
  291.            endif;
  292.         endif;
  293.  
  294. //        VarRestore(SRCTARGETDIR);
  295.  
  296.         Delay( 1 );
  297.         Disable( STATUSDLG );
  298.  
  299.         // Create/Update Engagego.ini in the Windows directory
  300.         nReturn = LaunchAppAndWait(svTarget ^ "egosetup.exe","",WAIT);
  301.         if (nReturn < 0) then
  302.            szMsg = "Launch of egosetup failed\n";
  303.            MessageBox( szMsg, WARNING );
  304.         endif;
  305.  
  306.         // Install the Ichat plug-in for Internet Explorer
  307.         if (GetHandAndLaunchAppWait(SRCDIR ^ "icie222.exe", "", "InstallShield_Win", "Setup", WAIT) < 0) then
  308.            MessageBox("Ichat EXE launch failed\n", WARNING);
  309.         endif;
  310.  
  311.    UpdateApplications:
  312.         szDialogMsg="Setup is checking for any installed games...";
  313.         SdShowMsg (szDialogMsg, TRUE);
  314.  
  315.            LaunchAppAndWait(UENGAGE1_EXE, UENGAGE1_OPTIONS, WAIT);
  316.  
  317.         SdShowMsg (szDialogMsg, FALSE);
  318.  
  319.    SetupEngageRegistryPaths:
  320.         AddApplicationPathsToRegistry();
  321.  
  322.    // Announce setup complete and offer to read README file.
  323.    FinalInstallProcess:
  324.         SetStatusWindow( 100, "Installation complete." );
  325.  
  326.    GetDirectXVersion:
  327.         nDirectXVersion=CheckDirectXVersion();
  328.         if (nDirectXVersion=0) then
  329.            szMsg = COMPLETE_DX3;
  330.            //szMsg = "Setup of the GamesZone System Components for Microsoft Internet Explorer " +
  331.            //        "is complete. You must install DirectX before you can play any of the " +
  332.            //        "GamesZone Online Games. DirectX is available at www.gameszone.net.";
  333.         else
  334.            szMsg = COMPLETE_NODX3;
  335.            //szMsg = "Setup is complete.  You will be able to access GamesZone games online at"+
  336.            //        "at www.gameszone.net the next time you start Microsoft Internet Explorer.";
  337.         endif;
  338.         //MessageBox( szMsg, INFORMATION );
  339.  
  340.    LaunchIE:
  341.         //szMsg = szMsg + "\n\nWould you like to connect to www.gameszone.net now?";
  342.         szMsg = szMsg + WWW_LAUNCH_TEXT;
  343.         if (AskYesNo(szMsg, YES) = YES) then
  344.            LaunchInternetExplorer (WWW_LAUNCH_SITE);
  345.         endif;
  346.  
  347.  
  348.    exit;
  349.  
  350.       #include "SdDialog.Rul"
  351.       #include "DirectX.Rul"
  352.       #include "Browsers.Rul"
  353.  
  354.  
  355. /*---------------------------------------------------------------------------*\
  356.  *
  357.  * Function:  SetupScreen
  358.  *
  359.  *  Purpose:  This function will set up the screen look.  This includes
  360.  *            colors, fonts, text to be displayed, etc.
  361.  *
  362.  *
  363.  *    Input:
  364.  *
  365.  *  Returns:
  366.  *
  367.  * Comments:
  368. \*---------------------------------------------------------------------------*/
  369. function SetupScreen()
  370.         number nDx, nDy;
  371. begin
  372.         GetExtents( nDx, nDy );
  373.  
  374.         Enable( FULLWINDOWMODE );
  375.         Enable( INDVFILESTATUS );
  376.         Enable( BITMAP256COLORS );
  377.  
  378.         SetTitle( "Installing " + APP_NAME, 24, WHITE );
  379.  
  380.         SetColor( BACKGROUND, BK_BLUE ); // Dark blue.
  381.         SetColor( STATUSBAR, BLUE );     // Bright blue.
  382.         SetTitle( "Engage", 0, BACKGROUNDCAPTION ); // Caption bar text.
  383.  
  384.         Enable( BACKGROUND );
  385.  
  386.         Delay( 1 );
  387.  
  388. end;
  389.  
  390.  
  391. /*---------------------------------------------------------------------------*\
  392.  *
  393.  * Function:  CheckRequirements
  394.  *
  395.  *  Purpose:  This function will check all minimum requirements for the
  396.  *            application being installed.  If any fail, then the user
  397.  *            is informed and the installation is terminated.
  398.  *
  399.  *
  400.  *    Input:
  401.  *
  402.  *  Returns:
  403.  *
  404.  * Comments:
  405. \*---------------------------------------------------------------------------*/
  406. function CheckRequirements()
  407. number nvResult;
  408. STRING svResult, szKey;
  409.  
  410.  
  411. begin
  412.  
  413.         // Determine the target system's operating system.
  414.         GetSystemInfo( OS, nvResult, svResult );       
  415.         if (nvResult != IS_WINDOWS95) then
  416.            MessageBox( "This program requires the Windows 95 Operating System.", WARNING);
  417.            exit;
  418.         endif;
  419.  
  420.         // Check Internet Explorer Version
  421.         if (!CheckBrowserVersion ("Internet Explorer", "3.0")) then
  422.            // Ask user to verify Internet Explorer version
  423.            if (AskYesNo("This program requires Microsoft Internet Explorer version 3.0 or better!\n" +
  424.                      "Would you like to continue?", YES) = NO) then
  425.               MessageBox("Installation terminated by the user!", WARNING);
  426.               exit;
  427.            endif;
  428.         endif;
  429.  
  430.         // Look in the Registry for the Internet Explorer key
  431.         RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
  432.         szKey = "\\SOFTWARE\\Microsoft\\Internet Explorer";
  433.  
  434.         if (RegDBKeyExist(szKey) < 0) then
  435.            MessageBox( "Unable to locate Internet Exlorer registry entries", WARNING);
  436.            exit;
  437.         endif;
  438.  
  439.         // Make sure that Internet Explorer is not running!
  440.         CloseInternetExplorer();
  441.  
  442.         // Check for Explorer Java settings
  443.         if (!CheckExplorerJavaSettings()) then
  444.            if (AskYesNo("In order to access the GamesZone WWW site, Java and JavaScript must be enabled.\n" +
  445.                         "Would you like to enable them?", YES) = NO) then
  446.               if (AskYesNo("Would you like to continue with the installation?", YES) = NO) then
  447.                  MessageBox("Installation terminated by the user!", WARNING);
  448.                  exit;
  449.               endif;
  450.            else
  451.               SetExplorerJavaSettings();
  452.            endif;
  453.         endif;
  454.  
  455. end;
  456.  
  457. function GetHandAndLaunchAppWait(szProgram,
  458.                                  szCmdLine,
  459.                                  szClassName,
  460.                                  szWinName,
  461.                                  lWait)
  462. NUMBER n, icnt;
  463. HWND hwnd;
  464. begin
  465.  
  466.    n = LaunchApp(szProgram, szCmdLine);
  467.  
  468.    if lWait = WAIT then
  469.       if n = 0 then
  470.  
  471.          hwnd = NULL;
  472.          icnt = 15000;   // So the routine will exit if the Launched App failed 
  473.  
  474.          // Wait for the specified window handle to appear
  475.          while ((hwnd = NULL) && (icnt > 0))
  476.             Sleep(0);
  477.             hwnd = FindWindow(szClassName, szWinName);
  478.             icnt = icnt - 1;
  479.          endwhile;
  480.  
  481.          // Wait for the specified window handle to disappear
  482.          while (hwnd != NULL)
  483.             Sleep(0);
  484.             hwnd = FindWindow(szClassName, szWinName);
  485.          endwhile;
  486.  
  487.       endif;
  488.    endif;
  489.    return n;
  490. end;
  491.  
  492. /***************************************************************************/
  493. /***                                                                     ***/
  494. /***    AddApplicationPathsToRegistry                                    ***/
  495. /***                                                                     ***/
  496. /***    This function will add the Plug-In path and System path for the  ***/
  497. /***    Internet Explorer setup.                                         ***/
  498. /***                                                                     ***/
  499. /***    It gets the Plug-In path by searching for IEXPLORE.EXE and       ***/
  500. /***    concatinating "PlugIns" to it. It then prompts the user with     ***/
  501. /***    this directory for confirmation or for an entry if it does not   ***/
  502. /***    find IEXPLORE.EXE.                                               ***/
  503. /***                                                                     ***/
  504. /***    and the System path from szTarget.                               ***/
  505. /***                                                                     ***/
  506. /***    It puts this information in:                                     ***/
  507. /***       [HKEY_LOCAL_MACHINE\Software\Engage Games Online\             ***/
  508. /***                            Engage System Components]                ***/
  509. /***       "PlugInPath"=                                                 ***/
  510. /***       "SystemPath"=                                                 ***/
  511. /***                                                                     ***/
  512. /***************************************************************************/
  513. function AddApplicationPathsToRegistry()
  514.         STRING szPlugInPath, szSearchPath, szRegValue, szDialogMsg, szIEPath;
  515.         NUMBER nPos, nSearchResult, nFound, nvType, nvSize, nvByte;
  516. begin
  517.  
  518.         // Get IEXPLORE.EXE directory
  519.         RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
  520.         if( !RegDBGetKeyValueEx(IEXPLORE_EXE_KEY, PATH_KEY, nvType, szIEPath, nvSize) < 0 ) then
  521.            // Strip off ';'
  522.            nPos = StrFind(szIEPath,";");
  523.            SetByte(szIEPath, nPos, 0);
  524.            szPlugInPath = szIEPath ^ "PlugIns";
  525.         endif;
  526.  
  527.         if (ExistsDir(szPlugInPath)=NOTEXISTS) then
  528.            AskPath( "Please enter your Internet Explorer Plug-Ins directory", szPlugInPath, szPlugInPath);
  529.         endif;
  530.  
  531.         // Set registry values
  532.  
  533.         // Set the base key for these entries
  534.         RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
  535.  
  536.         // Set key that we are going to create entries under
  537.         //szKey = SYSTEM_COMPONENTS_KEY;
  538.         szKey = IE_VERSIONING_KEY;
  539.  
  540.         // Create Key
  541.         RegDBCreateKeyEx( szKey, "" );
  542.  
  543.         // Add entries under key
  544.            // Strip off trailing slash after System Path
  545.            szRegValue = svTarget;
  546.            nPos = StrLength(szRegValue);
  547.            nPos--;
  548.            GetByte (nvByte, szRegValue, nPos);
  549.            while (nvByte=92)
  550.               nPos--;
  551.               GetByte (nvByte, szRegValue, nPos);
  552.            endwhile;
  553.            nPos++;
  554.            SetByte (szRegValue, nPos, 0);
  555.  
  556.            // Add System path to registry
  557.            RegDBSetKeyValueEx( szKey, SYSTEM_PATH_KEY, REGDB_STRING, szRegValue, -1 );
  558.  
  559.            // Strip off trailing slash after Plug-In path
  560.            szRegValue = szPlugInPath;
  561.            nPos = StrLength(szRegValue);
  562.            nPos--;
  563.            GetByte (nvByte, szRegValue, nPos);
  564.            while (nvByte=92)
  565.               nPos--;
  566.               GetByte (nvByte, szRegValue, nPos);
  567.            endwhile;
  568.            nPos++;
  569.            SetByte (szRegValue, nPos, 0);
  570.  
  571.            // Add Plug-In path to registry
  572.            RegDBSetKeyValueEx( szKey, PLUG_IN_PATH_KEY, REGDB_STRING, szRegValue, -1 );
  573.  
  574.         // Copy Versioning DLL to the Plug-In Path
  575.         VarSave(SRCTARGETDIR);
  576.         TARGETDIR = szPlugInPath;
  577.         CopyFile("NPeover.dll", "NPeover.dll");
  578.         VarRestore(SRCTARGETDIR);
  579. end;
  580.